GCC_BIN_IOS=`xcrun --sdk iphoneos -f gcc`
GCC_BASE_IOS=$(GCC_BIN_IOS)
SDK_IOS=`xcrun --sdk iphoneos --show-sdk-path`
GCC_IOS_32=$(GCC_BASE_IOS) $(CFLAGS_32) -arch armv7 -isysroot $(SDK_IOS) \
		-Iheaders

all: clean loader macho

loader:
	$(GCC_IOS_32) -mthumb -shared -O0 loader.c -o loader
	python macho_to_bin.py loader

macho:
	$(GCC_IOS_32) -O0 -fmodules -mthumb macho.m task.c utils.m shell.m -o macho

install: loader.bin macho
	mkdir -p ../../../../data/exploits/CVE-2016-4669/
	cp loader.bin ../../../../data/exploits/CVE-2016-4669/
	cp macho ../../../../data/exploits/CVE-2016-4669/

clean:
	rm -f *.o loader.bin loader macho

